Spotted by eslint.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607
this._buttonBox = new St.BoxLayout({ style_class: 'login-dialog-button-box',
vertical: false });
this.actor.add(this._buttonBox,
- { expand: true,
+ { expand: true,
x_align: St.Align.MIDDLE,
y_align: St.Align.END });
var UserList = class {
constructor() {
- this.actor = new St.ScrollView({ style_class: 'login-dialog-user-list-view'});
+ this.actor = new St.ScrollView({ style_class: 'login-dialog-user-list-view' });
this.actor.set_policy(St.PolicyType.NEVER,
St.PolicyType.AUTOMATIC);
this._indexChanged();
}
- return this._historyIndex ? this._history[this._historyIndex -1] : null;
+ return this._historyIndex ? this._history[this._historyIndex - 1] : null;
}
addItem(input) {
function findMatchingQuote(expr, offset) {
let quoteChar = expr.charAt(offset);
for (let i = offset - 1; i >= 0; --i) {
- if (expr.charAt(i) == quoteChar && expr.charAt(i-1) != '\\'){
+ if (expr.charAt(i) == quoteChar && expr.charAt(i - 1) != '\\') {
return i;
}
}
// Given the ending position of a regex, find where it starts
function findMatchingSlash(expr, offset) {
for (let i = offset - 1; i >= 0; --i) {
- if (expr.charAt(i) == '/' && expr.charAt(i-1) != '\\'){
+ if (expr.charAt(i) == '/' && expr.charAt(i - 1) != '\\') {
return i;
}
}
// findMatchingBrace("[(])", 3) returns 1.
function findMatchingBrace(expr, offset) {
let closeBrace = expr.charAt(offset);
- let openBrace = ({')': '(', ']': '['})[closeBrace];
+ let openBrace = ({ ')': '(', ']': '[' })[closeBrace];
function findTheBrace(expr, offset) {
if (offset < 0) {
while (offset >= 0) {
let currChar = expr.charAt(offset);
- if (isStopChar(currChar)){
+ if (isStopChar(currChar)) {
return offset + 1;
}
}
let propsUnique = {};
- if (typeof obj === 'object'){
+ if (typeof obj === 'object') {
let allProps = getAllProps(obj);
// Get only things we are allowed to complete following a '.'
allProps = allProps.filter( isValidPropertyName );
this._currentKeymap.options == options)
return;
- this._currentKeymap = {layouts, variants, options};
+ this._currentKeymap = { layouts, variants, options };
Meta.get_backend().set_keymap(layouts, variants, options);
}
this._objectManager = new ObjectManager.ObjectManager({ connection: Gio.DBus.session,
name: "org.gnome.SettingsDaemon.Smartcard",
objectPath: '/org/gnome/SettingsDaemon/Smartcard',
- knownInterfaces: [ SmartcardTokenIface ],
+ knownInterfaces: [SmartcardTokenIface],
onLoaded: this._onLoaded.bind(this) });
this._insertedTokens = {};
this._loginToken = null;
let results = [];
- for (let [key, {available, keywords}] of this._actions)
+ for (let [key, { available, keywords }] of this._actions)
if (available && terms.every(t => keywords.some(k => k.startsWith(t))))
results.push(key);
/* Translators: Time in 24h format */
format = N_("%H\u2236%M");
// Show the word "Yesterday" and time if date is on yesterday
- else if (daysAgo <2)
+ else if (daysAgo < 2)
/* Translators: this is the word "Yesterday" followed by a
time string in 24h format. i.e. "Yesterday, 14:30" */
// xgettext:no-c-format
/* Translators: Time in 12h format */
format = N_("%l\u2236%M %p");
// Show the word "Yesterday" and time if date is on yesterday
- else if (daysAgo <2)
+ else if (daysAgo < 2)
/* Translators: this is the word "Yesterday" followed by a
time string in 12h format. i.e. "Yesterday, 2:30 pm" */
// xgettext:no-c-format
var CloseButton = GObject.registerClass(
class CloseButton extends St.Button {
_init(boxpointer) {
- super._init({ style_class: 'notification-close'});
+ super._init({ style_class: 'notification-close' });
// This is a bit tricky. St.Bin has its own x-align/y-align properties
// that compete with Clutter's properties. This should be fixed for
units: "frames / s" },
overviewLatencySubsequent:
{ description: "Time to first frame after triggering overview, second time",
- units: "us"},
+ units: "us" },
overviewFpsSubsequent:
{ description: "Frames rate when going to the overview, second time",
units: "frames / s" },
units: "us" },
applicationsShowTimeSubsequent:
{ description: "Time to switch to applications view, second time",
- units: "us"}
+ units: "us" }
};
let WINDOW_CONFIGS = [
Main.overview.hide();
yield Scripting.createTestWindow({ maximized: true,
- redraws: true});
+ redraws: true });
yield Scripting.waitTestWindows();
yield Scripting.sleep(1000);
if (len == 0)
median = -1;
else if (len % 2 == 1)
- median = times[(len - 1)/ 2];
+ median = times[(len - 1) / 2];
else
median = Math.round((times[len / 2 - 1] + times[len / 2]) / 2);
single_line_mode: true,
ellipsize: Pango.EllipsizeMode.END,
valign: Gtk.Align.BASELINE,
- selectable: true});
+ selectable: true });
this.subtitleLabel.get_style_context().add_class('subtitle');
hbox.add(this.subtitleLabel);
this.addButton({ label: grantLabel,
action: () => {
this._sendResponse(DialogResponse.OK);
- }});
+ } });
}
open() {
_setIconSize() {
let j = 0;
- while(this._items.length > 1 && this._items[j].style_class != 'item-box') {
+ while (this._items.length > 1 && this._items[j].style_class != 'item-box') {
j++;
}
let themeNode = this._items[j].get_theme_node();
let iconSize = baseIconSizes[0];
if (this._items.length > 1) {
- for(let i = 0; i < baseIconSizes.length; i++) {
+ for (let i = 0; i < baseIconSizes.length; i++) {
iconSize = baseIconSizes[i];
let height = iconSizes[i] + iconSpacing;
let w = height * this._items.length + totalSpacing;
this._iconSize = iconSize;
- for(let i = 0; i < this.icons.length; i++) {
+ for (let i = 0; i < this.icons.length; i++) {
if (this.icons[i].icon != null)
break;
this.icons[i].set_size(iconSize);
};
var Spinner = class extends AnimatedIcon {
- constructor(size, animate=false) {
+ constructor(size, animate = false) {
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/process-working.svg');
super(file, size);
padWithSpacing: true });
params = Params.parse(params, { usePagination: false });
- if(params.usePagination)
+ if (params.usePagination)
this._grid = new IconGrid.PaginatedIconGrid(gridParams);
else
this._grid = new IconGrid.IconGrid(gridParams);
reactive: true,
y_align: St.Align.START });
this.actor = new St.Widget({ layout_manager: new Clutter.BinLayout(),
- x_expand:true, y_expand:true });
+ x_expand: true, y_expand: true });
this.actor.add_actor(this._scrollView);
this._scrollView.set_policy(St.PolicyType.NEVER,
this._eventBlocker.reactive = isOpen;
this._currentPopup = isOpen ? popup : null;
this._updateIconOpacities(isOpen);
- if(!isOpen)
+ if (!isOpen)
this._closeSpaceForPopup();
});
}
let mostUsed = this._usage.get_most_used();
let hasUsefulData = this.hasUsefulData();
this._noFrequentAppsLabel.visible = !hasUsefulData;
- if(!hasUsefulData)
+ if (!hasUsefulData)
return;
// Allow dragging of the icon only if the Dash would accept a drop to
_onAllocatedSizeChanged(actor, width, height) {
let box = new Clutter.ActorBox();
- box.x1 = box.y1 =0;
+ box.x1 = box.y1 = 0;
box.x2 = width;
box.y2 = height;
box = this._viewStack.get_theme_node().get_content_box(box);
adaptToSize(width, height) {
this._parentAvailableWidth = width;
this._parentAvailableHeight = height;
- if(this._popup)
+ if (this._popup)
this.view.adaptToSize(width, height);
this._popupInvalidated = true;
}
}
_getDeviceLabel(device) {
- switch(device) {
+ switch (device) {
case AudioDevice.HEADPHONES:
return _("Headphones");
case AudioDevice.HEADSET:
}
_getDeviceIcon(device) {
- switch(device) {
+ switch (device) {
case AudioDevice.HEADPHONES:
return 'audio-headphones-symbolic';
case AudioDevice.HEADSET:
let borderRadius = themeNode.get_length('-arrow-border-radius');
let halfBorder = borderWidth / 2;
- let halfBase = Math.floor(base/2);
+ let halfBase = Math.floor(base / 2);
let backgroundColor = themeNode.get_color('-arrow-background-color');
if (!skipTopRight) {
cr.lineTo(x2 - borderRadius, y1);
cr.arc(x2 - borderRadius, y1 + borderRadius, borderRadius,
- 3*Math.PI/2, Math.PI*2);
+ 3 * Math.PI / 2, Math.PI * 2);
}
if (this._arrowSide == St.Side.RIGHT && rise) {
if (!skipBottomRight) {
cr.lineTo(x2, y2 - borderRadius);
cr.arc(x2 - borderRadius, y2 - borderRadius, borderRadius,
- 0, Math.PI/2);
+ 0, Math.PI / 2);
}
if (this._arrowSide == St.Side.BOTTOM && rise) {
if (!skipBottomLeft) {
cr.lineTo(x1 + borderRadius, y2);
cr.arc(x1 + borderRadius, y2 - borderRadius, borderRadius,
- Math.PI/2, Math.PI);
+ Math.PI / 2, Math.PI);
}
if (this._arrowSide == St.Side.LEFT && rise) {
if (!skipTopLeft) {
cr.lineTo(x1, y1 + borderRadius);
cr.arc(x1 + borderRadius, y1 + borderRadius, borderRadius,
- Math.PI, 3*Math.PI/2);
+ Math.PI, 3 * Math.PI / 2);
}
Clutter.cairo_set_source_color(cr, backgroundColor);
// of the box to maintain the arrow's accuracy.
let arrowOrigin;
- let halfBase = Math.floor(arrowBase/2);
+ let halfBase = Math.floor(arrowBase / 2);
let halfBorder = borderWidth / 2;
let halfMargin = margin / 2;
let [x1, y1] = [halfBorder, halfBorder];
if (!this._initialized)
return;
- if (this._curRequestBegin && this._curRequestEnd){
+ if (this._curRequestBegin && this._curRequestEnd) {
this._dbusProxy.GetEventsRemote(this._curRequestBegin.getTime() / 1000,
this._curRequestEnd.getTime() / 1000,
forceReload,
getEvents(begin, end) {
let result = [];
- for(let n = 0; n < this._events.length; n++) {
+ for (let n = 0; n < this._events.length; n++) {
let event = this._events[n];
if (_dateIntervalsOverlap (event.date, event.end, begin, end)) {
this._topBox.add(this._backButton);
this._backButton.connect('clicked', this._onPrevMonthButtonClicked.bind(this));
- this._monthLabel = new St.Label({style_class: 'calendar-month-label',
- can_focus: true });
+ this._monthLabel = new St.Label({ style_class: 'calendar-month-label',
+ can_focus: true });
this._topBox.add(this._monthLabel, { expand: true, x_fill: false, x_align: St.Align.MIDDLE });
this._forwardButton = new St.Button({ style_class: 'calendar-change-month-forward pager-button',
_addSection(section) {
let obj = {
destroyId: 0,
- visibleId: 0,
+ visibleId: 0,
emptyChangedId: 0,
canClearChangedId: 0,
keyFocusId: 0
var ALIVE_TIMEOUT = 5000;
var CloseDialog = GObject.registerClass({
- Implements: [ Meta.CloseDialog ],
+ Implements: [Meta.CloseDialog],
Properties: {
'window': GObject.ParamSpec.override('window', Meta.CloseDialog)
},
this._dialog.height = windowActor.height;
this._dialog.addContent(this._createDialogContent());
- this._dialog.addButton({ label: _('Force Quit'),
- action: this._onClose.bind(this),
+ this._dialog.addButton({ label: _('Force Quit'),
+ action: this._onClose.bind(this),
default: true });
- this._dialog.addButton({ label: _('Wait'),
+ this._dialog.addButton({ label: _('Wait'),
action: this._onWait.bind(this),
- key: Clutter.Escape });
+ key: Clutter.Escape });
global.focus_manager.add_group(this._dialog);
}
descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
contentBox.messageBox.add(descriptionLabel,
- { y_fill: true,
+ { y_fill: true,
y_align: St.Align.START,
expand: true });
}
- this._okButton = { label: _("Connect"),
+ this._okButton = { label: _("Connect"),
action: this._onOk.bind(this),
default: true
};
this.setButtons([{ label: _("Cancel"),
action: this.cancel.bind(this),
- key: Clutter.KEY_Escape,
+ key: Clutter.KEY_Escape,
},
this._okButton]);
let ssid;
let content = { };
- content.secrets = [ ];
+ content.secrets = [];
switch (connectionType) {
case '802-11-wireless':
this._pluginOutBuffer = [];
this._title = null;
this._description = null;
- this._content = [ ];
+ this._content = [];
this._shellDialog = null;
let connectionSetting = connection.get_setting_connection();
- let argv = [ authHelper.fileName,
+ let argv = [authHelper.fileName,
'-u', connectionSetting.uuid,
'-n', connectionSetting.id,
'-s', serviceType
styleClass: 'polkit-dialog-user-icon' });
this._userAvatar.actor.hide();
userBox.add(this._userAvatar.actor,
- { x_fill: true,
- y_fill: false,
+ { x_fill: true,
+ y_fill: false,
x_align: St.Align.END,
y_align: St.Align.START });
let userLabel = new St.Label(({ style_class: 'polkit-dialog-user-label',
text: userRealName }));
userBox.add(userLabel,
- { x_fill: true,
- y_fill: false,
+ { x_fill: true,
+ y_fill: false,
x_align: St.Align.END,
y_align: St.Align.MIDDLE });
}
this._passwordBox.add(this._passwordLabel, { y_fill: false, y_align: St.Align.MIDDLE });
this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
text: "",
- can_focus: true});
+ can_focus: true });
ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
this._passwordEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
this._passwordBox.add(this._passwordEntry,
* gnome-shell.css sets the color to be transparent
*/
this._nullMessageLabel = new St.Label({ style_class: 'prompt-dialog-null-label',
- text: 'abc'});
+ text: 'abc' });
this._nullMessageLabel.add_style_class_name('hidden');
this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._nullMessageLabel.clutter_text.line_wrap = true;
this._cancelButton = this.addButton({ label: _("Cancel"),
action: this.cancel.bind(this),
key: Clutter.Escape });
- this._okButton = this.addButton({ label: _("Authenticate"),
+ this._okButton = this.addButton({ label: _("Authenticate"),
action: this._onAuthenticateButtonPressed.bind(this),
default: true });
x_align: Clutter.ActorAlign.CENTER });
this._labelText = "";
- this.label = new St.Label({ style_class: 'dash-label'});
+ this.label = new St.Label({ style_class: 'dash-label' });
this.label.hide();
Main.layoutManager.addChrome(this.label);
this.label_actor = this.label;
}
});
-const baseIconSizes = [ 16, 22, 24, 32, 48, 64 ];
+const baseIconSizes = [16, 22, 24, 32, 48, 64];
var Dash = class Dash {
constructor() {
_createDialog() {
this._dialog = new St.BoxLayout({ style_class: 'modal-dialog',
- x_align: Clutter.ActorAlign.CENTER,
- y_align: Clutter.ActorAlign.CENTER,
- vertical: true });
+ x_align: Clutter.ActorAlign.CENTER,
+ y_align: Clutter.ActorAlign.CENTER,
+ vertical: true });
// modal dialogs are fixed width and grow vertically; set the request
// mode accordingly so wrapped labels are handled correctly during
this.contentLayout = new St.BoxLayout({ vertical: true,
style_class: "modal-dialog-content-box" });
this._dialog.add(this.contentLayout,
- { expand: true,
- x_fill: true,
- y_fill: true,
+ { expand: true,
+ x_fill: true,
+ y_fill: true,
x_align: St.Align.MIDDLE,
y_align: St.Align.START });
- this.buttonLayout = new St.Widget ({ layout_manager: new Clutter.BoxLayout({ homogeneous:true }) });
+ this.buttonLayout = new St.Widget ({ layout_manager: new Clutter.BoxLayout({ homogeneous: true }) });
this._dialog.add(this.buttonLayout,
{ x_align: St.Align.MIDDLE,
y_align: St.Align.START });
let button = new St.Button({ style_class: 'modal-dialog-linked-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
- reactive: true,
- can_focus: true,
- x_expand: true,
- y_expand: true,
- label: label });
+ reactive: true,
+ can_focus: true,
+ x_expand: true,
+ y_expand: true,
+ label: label });
button.connect('clicked', action);
buttonInfo['button'] = button;
},
showBatteryWarning: false,
confirmButtons: [{ signal: 'ConfirmedLogout',
- label: C_("button", "Log Out") }],
+ label: C_("button", "Log Out") }],
iconStyleClass: 'end-session-dialog-logout-icon',
showOtherSessions: false,
};
checkBoxText: C_("checkbox", "Install pending software updates"),
showBatteryWarning: true,
confirmButtons: [{ signal: 'ConfirmedReboot',
- label: C_("button", "Restart") },
+ label: C_("button", "Restart") },
{ signal: 'ConfirmedShutdown',
- label: C_("button", "Power Off") }],
+ label: C_("button", "Power Off") }],
iconName: 'system-shutdown-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon',
showOtherSessions: true,
},
showBatteryWarning: false,
confirmButtons: [{ signal: 'ConfirmedReboot',
- label: C_("button", "Restart") }],
+ label: C_("button", "Restart") }],
iconName: 'view-refresh-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon',
showOtherSessions: true,
},
showBatteryWarning: true,
confirmButtons: [{ signal: 'ConfirmedReboot',
- label: C_("button", "Restart & Install") }],
+ label: C_("button", "Restart & Install") }],
unusedFutureButtonForTranslation: C_("button", "Install & Power Off"),
unusedFutureCheckBoxForTranslation: C_("checkbox", "Power off after updates are installed"),
iconName: 'view-refresh-symbolic',
disableTimer: true,
showBatteryWarning: false,
confirmButtons: [{ signal: 'ConfirmedReboot',
- label: C_("button", "Restart & Install") }],
+ label: C_("button", "Restart & Install") }],
iconName: 'view-refresh-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon',
showOtherSessions: true,
this._iconBin = new St.Bin();
mainContentLayout.add(this._iconBin,
- { x_fill: true,
- y_fill: false,
+ { x_fill: true,
+ y_fill: false,
x_align: St.Align.END,
y_align: St.Align.START });
messageLayout.add(this._subjectLabel,
{ x_fill: false,
- y_fill: false,
+ y_fill: false,
x_align: St.Align.START,
y_align: St.Align.START });
this._descriptionLabel.clutter_text.line_wrap = true;
messageLayout.add(this._descriptionLabel,
- { y_fill: true,
+ { y_fill: true,
y_align: St.Align.START });
this._checkBox = new CheckBox.CheckBox();
_updateButtons() {
let dialogContent = DialogContent[this._type];
let buttons = [{ action: this.cancel.bind(this),
- label: _("Cancel"),
- key: Clutter.Escape }];
+ label: _("Cancel"),
+ key: Clutter.Escape }];
for (let i = 0; i < dialogContent.confirmButtons.length; i++) {
let signal = dialogContent.confirmButtons[i].signal;
this._loginManager.listSessions(result => {
let n = 0;
for (let i = 0; i < result.length; i++) {
- let[id, uid, userName, seat, sessionPath] = result[i];
+ let [id, uid, userName, seat, sessionPath] = result[i];
let proxy = new LogindSession(Gio.DBus.system, 'org.freedesktop.login1', sessionPath);
if (proxy.Class != 'user')
}
function _loggingFunc(...args) {
- let fields = {'MESSAGE': args.join(', ')};
+ let fields = { 'MESSAGE': args.join(', ') };
let domain = "GNOME Shell";
// If the caller is an extension, add it as metadata
this.setButtons([{ label: _("Cancel"),
action: this._onCancelButtonPressed.bind(this),
- key: Clutter.Escape
+ key: Clutter.Escape
},
- { label: _("Install"),
+ { label: _("Install"),
action: this._onInstallButtonPressed.bind(this),
default: true
}]);
var MAX_CANDIDATES_PER_PAGE = 16;
-var DEFAULT_INDEX_LABELS = [ '1', '2', '3', '4', '5', '6', '7', '8',
- '9', '0', 'a', 'b', 'c', 'd', 'e', 'f' ];
+var DEFAULT_INDEX_LABELS = ['1', '2', '3', '4', '5', '6', '7', '8',
+ '9', '0', 'a', 'b', 'c', 'd', 'e', 'f'];
var CandidateArea = class CandidateArea {
constructor() {
this.actor.connect('scroll-event', (actor, event) => {
let direction = event.get_scroll_direction();
- switch(direction) {
+ switch (direction) {
case Clutter.ScrollDirection.UP:
this.emit('cursor-up');
break;
var EXTRA_SPACE_ANIMATION_TIME = 0.25;
var ANIMATION_TIME_IN = 0.350;
-var ANIMATION_TIME_OUT = 1/2 * ANIMATION_TIME_IN;
-var ANIMATION_MAX_DELAY_FOR_ITEM = 2/3 * ANIMATION_TIME_IN;
-var ANIMATION_BASE_DELAY_FOR_ITEM = 1/4 * ANIMATION_MAX_DELAY_FOR_ITEM;
-var ANIMATION_MAX_DELAY_OUT_FOR_ITEM = 2/3 * ANIMATION_TIME_OUT;
-var ANIMATION_FADE_IN_TIME_FOR_ITEM = 1/4 * ANIMATION_TIME_IN;
+var ANIMATION_TIME_OUT = 1 / 2 * ANIMATION_TIME_IN;
+var ANIMATION_MAX_DELAY_FOR_ITEM = 2 / 3 * ANIMATION_TIME_IN;
+var ANIMATION_BASE_DELAY_FOR_ITEM = 1 / 4 * ANIMATION_MAX_DELAY_FOR_ITEM;
+var ANIMATION_MAX_DELAY_OUT_FOR_ITEM = 2 / 3 * ANIMATION_TIME_OUT;
+var ANIMATION_FADE_IN_TIME_FOR_ITEM = 1 / 4 * ANIMATION_TIME_IN;
var ANIMATION_BOUNCE_ICON_SCALE = 1.1;
}
var IconGrid = GObject.registerClass({
- Signals: {'animation-done': {},
- 'child-focused': { param_types: [Clutter.Actor.$gtype]} },
+ Signals: { 'animation-done': {},
+ 'child-focused': { param_types: [Clutter.Actor.$gtype] } },
}, class IconGrid extends St.Widget {
_init(params) {
super._init({ style_class: 'icon-grid',
let [nColumns, usedWidth] = this._computeLayout(availWidth);
let leftEmptySpace;
- switch(this._xAlign) {
+ switch (this._xAlign) {
case St.Align.START:
leftEmptySpace = 0;
break;
onComplete: () => {
if (isLastItem)
this._animationDone();
- }};
+ } };
fadeParams = { time: ANIMATION_FADE_IN_TIME_FOR_ITEM,
transition: 'easeInOutQuad',
delay: delay,
onComplete: () => {
if (isLastItem)
this._animationDone();
- }};
+ } };
fadeParams = { time: ANIMATION_FADE_IN_TIME_FOR_ITEM,
transition: 'easeInOutQuad',
delay: ANIMATION_TIME_OUT + delay - ANIMATION_FADE_IN_TIME_FOR_ITEM,
if (this._padWithSpacing) {
// minRows + 1 because we want to put spacing before the first row, so it is like we have one more row
// to divide the empty space
- maxVSpacing = Math.floor(maxEmptyVArea / (this._minRows +1));
- maxHSpacing = Math.floor(maxEmptyHArea / (this._minColumns +1));
+ maxVSpacing = Math.floor(maxEmptyVArea / (this._minRows + 1));
+ maxHSpacing = Math.floor(maxEmptyHArea / (this._minColumns + 1));
} else {
if (this._minRows <= 1)
maxVSpacing = maxEmptyVArea;
this._updateSpacingForSize(availWidth, availHeight);
if (this.columnsForWidth(availWidth) < this._minColumns || this.rowsForHeight(availHeight) < this._minRows) {
- let neededWidth = this.usedWidthForNColumns(this._minColumns) - availWidth ;
- let neededHeight = this.usedHeightForNRows(this._minRows) - availHeight ;
+ let neededWidth = this.usedWidthForNColumns(this._minColumns) - availWidth;
+ let neededHeight = this.usedHeightForNRows(this._minRows) - availHeight;
let neededSpacePerItem = (neededWidth > neededHeight) ? Math.ceil(neededWidth / this._minColumns)
: Math.ceil(neededHeight / this._minRows);
});
var PaginatedIconGrid = GObject.registerClass({
- Signals: {'space-opened': {},
- 'space-closed': {} },
+ Signals: { 'space-opened': {},
+ 'space-closed': {} },
}, class PaginatedIconGrid extends IconGrid {
_init(params) {
super._init(params);
let [nColumns, usedWidth] = this._computeLayout(availWidth);
let leftEmptySpace;
- switch(this._xAlign) {
+ switch (this._xAlign) {
case St.Align.START:
leftEmptySpace = 0;
break;
const KEY_SIZE = 2;
const defaultKeysPre = [
- [ [], [], [{ width: 1.5, level: 1, extraClassName: 'shift-key-lowercase' }], [{ label: '?123', width: 1.5, level: 2 }] ],
- [ [], [], [{ width: 1.5, level: 0, extraClassName: 'shift-key-uppercase' }], [{ label: '?123', width: 1.5, level: 2 }] ],
- [ [], [], [{ label: '=/<', width: 1.5, level: 3 }], [{ label: 'ABC', width: 1.5, level: 0 }] ],
- [ [], [], [{ label: '?123', width: 1.5, level: 2 }], [{ label: 'ABC', width: 1.5, level: 0 }] ],
+ [[], [], [{ width: 1.5, level: 1, extraClassName: 'shift-key-lowercase' }], [{ label: '?123', width: 1.5, level: 2 }]],
+ [[], [], [{ width: 1.5, level: 0, extraClassName: 'shift-key-uppercase' }], [{ label: '?123', width: 1.5, level: 2 }]],
+ [[], [], [{ label: '=/<', width: 1.5, level: 3 }], [{ label: 'ABC', width: 1.5, level: 0 }]],
+ [[], [], [{ label: '?123', width: 1.5, level: 2 }], [{ label: 'ABC', width: 1.5, level: 0 }]],
];
const defaultKeysPost = [
- [ [{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
+ [[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ width: 3, level: 1, right: true, extraClassName: 'shift-key-lowercase' }],
- [{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }] ],
- [ [{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
+ [{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
+ [[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ width: 3, level: 0, right: true, extraClassName: 'shift-key-uppercase' }],
- [{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }] ],
- [ [{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
+ [{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
+ [[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ label: '=/<', width: 3, level: 3, right: true }],
- [{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }] ],
- [ [{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
+ [{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
+ [[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ label: '?123', width: 3, level: 2, right: true }],
- [{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }] ],
+ [{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
];
var AspectContainer = GObject.registerClass(
this._animFocusedWindow = window;
}
- setCursorLocation(window, x, y , w, h) {
+ setCursorLocation(window, x, y, w, h) {
let monitor = Main.layoutManager.keyboardMonitor;
if (window && monitor) {
var HOT_CORNER_PRESSURE_TIMEOUT = 1000; // ms
function isPopupMetaWindow(actor) {
- switch(actor.meta_window.get_window_type()) {
+ switch (actor.meta_window.get_window_type()) {
case Meta.WindowType.DROPDOWN_MENU:
case Meta.WindowType.POPUP_MENU:
case Meta.WindowType.COMBO:
else
continue;
- let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1});
+ let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1 });
let strut = new Meta.Strut({ rect: strutRect, side: side });
struts.push(strut);
}
var LocatePointer = class {
constructor() {
- this._settings = new Gio.Settings({schema_id: LOCATE_POINTER_SCHEMA});
+ this._settings = new Gio.Settings({ schema_id: LOCATE_POINTER_SCHEMA });
this._ripples = new Ripples.Ripples(0.5, 0.5, 'ripple-pointer-location');
this._ripples.addTo(Main.uiGroup);
}
if (commonPrefix.length > 0) {
this.additionalCompletionText(commonPrefix, event.attrHead);
this.emit('completion', { completion: commonPrefix, type: 'prefix' });
- this.emit('suggest', { completions: event.completions});
+ this.emit('suggest', { completions: event.completions });
}
} else if (event.completions.length > 1 && event.tabType === 'double') {
- this.emit('suggest', { completions: event.completions});
+ this.emit('suggest', { completions: event.completions });
}
}
const CROSS_HAIRS_CLIP_KEY = 'cross-hairs-clip';
var MouseSpriteContent = GObject.registerClass({
- Implements: [ Clutter.Content ],
+ Implements: [Clutter.Content],
}, class MouseSpriteContent extends GObject.Object {
_init() {
super._init();
setActive(activate) {
let isActive = this.isActive();
- this._zoomRegions.forEach ((zoomRegion, index, array) => {
+ this._zoomRegions.forEach((zoomRegion, index, array) => {
zoomRegion.setActive(activate);
});
* @zoomRegion: The zoomRegion to add.
*/
addZoomRegion(zoomRegion) {
- if(zoomRegion) {
+ if (zoomRegion) {
this._zoomRegions.push(zoomRegion);
if (!this.isTrackingMouse())
this.startTrackingMouse();
viewPort.x = 0;
viewPort.y = 0;
viewPort.width = global.screen_width;
- viewPort.height = global.screen_height/2;
+ viewPort.height = global.screen_height / 2;
this._setViewPort(viewPort);
this._screenPosition = GDesktopEnums.MagnifierScreenPosition.TOP_HALF;
}
setBottomHalf() {
let viewPort = {};
viewPort.x = 0;
- viewPort.y = global.screen_height/2;
+ viewPort.y = global.screen_height / 2;
viewPort.width = global.screen_width;
- viewPort.height = global.screen_height/2;
+ viewPort.height = global.screen_height / 2;
this._setViewPort(viewPort);
this._screenPosition = GDesktopEnums.MagnifierScreenPosition.BOTTOM_HALF;
}
let viewPort = {};
viewPort.x = 0;
viewPort.y = 0;
- viewPort.width = global.screen_width/2;
+ viewPort.width = global.screen_width / 2;
viewPort.height = global.screen_height;
this._setViewPort(viewPort);
this._screenPosition = GDesktopEnums.MagnifierScreenPosition.LEFT_HALF;
*/
setRightHalf() {
let viewPort = {};
- viewPort.x = global.screen_width/2;
+ viewPort.x = global.screen_width / 2;
viewPort.y = 0;
- viewPort.width = global.screen_width/2;
+ viewPort.width = global.screen_width / 2;
viewPort.height = global.screen_height;
this._setViewPort(viewPort);
this._screenPosition = GDesktopEnums.MagnifierScreenPosition.RIGHT_HALF;
let xProportion = (xPoint - halfScreenWidth) / halfScreenWidth; // -1 ... 1
let yProportion = (yPoint - halfScreenHeight) / halfScreenHeight; // -1 ... 1
let xPos = xPoint - xProportion * (widthRoi / 2 - xPadding);
- let yPos = yPoint - yProportion * (heightRoi /2 - yPadding);
+ let yPos = yPoint - yProportion * (heightRoi / 2 - yPadding);
return [xPos, yPos];
}
container.raise_child(magnifiedMouse, crosshairsActor);
let [xMouse, yMouse] = magnifiedMouse.get_position();
let [crosshairsWidth, crosshairsHeight] = crosshairsActor.get_size();
- crosshairsActor.set_position(xMouse - crosshairsWidth / 2 , yMouse - crosshairsHeight / 2);
+ crosshairsActor.set_position(xMouse - crosshairsWidth / 2, yMouse - crosshairsHeight / 2);
}
}
return crosshairsActor;
'Expansion of the layout, between 0 (collapsed) ' +
'and 1 (fully expanded',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE,
- 0, 1, 0)},
+ 0, 1, 0) },
}, class LabelExpanderLayout extends Clutter.LayoutManager {
_init(params) {
this._expansion = 0;
onComplete() {
this._actionBin.hide();
this.expanded = false;
- }});
+ } });
} else {
this._bodyStack.layout_manager.expansion = 0;
this._actionBin.scale_y = 0;
onComplete() {
obj.container.destroy();
global.sync_pointer();
- }});
+ } });
} else {
obj.container.destroy();
global.sync_pointer();
transition: 'easeOutQuad',
onComplete() {
message.close();
- }});
+ } });
}
}
}
this.popModal(timestamp);
Tweener.addTween(this.dialogLayout,
{ opacity: 0,
- time: FADE_OUT_DIALOG_TIME,
+ time: FADE_OUT_DIALOG_TIME,
transition: 'easeOutQuad',
onComplete: () => {
this._setState(State.FADED_OUT);
if (actions.length) {
for (let i = 0; i < actions.length - 1; i += 2) {
- let [actionId, label] = [actions[i], actions[i+1]];
+ let [actionId, label] = [actions[i], actions[i + 1]];
if (actionId == 'default')
hasDefaultAction = true;
else
_createPolicy() {
if (this.app && this.app.get_app_info()) {
- let id = this.app.get_id().replace(/\.desktop$/,'');
+ let id = this.app.get_id().replace(/\.desktop$/, '');
return new MessageTray.NotificationApplicationPolicy(id);
} else {
return new MessageTray.NotificationGenericPolicy();
this.update(title.unpack(), body ? body.unpack() : null,
{ gicon: gicon ? Gio.icon_deserialize(gicon) : null,
- datetime : time ? GLib.DateTime.new_from_unix_local(time.unpack()) : null });
+ datetime: time ? GLib.DateTime.new_from_unix_local(time.unpack()) : null });
}
_activateAction(namespacedActionId, target) {
this._doneButton = new St.Button({ label: _("Done"),
style_class: 'button',
- x_expand: false});
+ x_expand: false });
this._doneButton.connect('clicked', this._onEditingDone.bind(this));
this.actor.add_actor(this._doneButton);
}
let cr = this.get_context();
cr.save();
- cr.translate(width/2, height/2);
+ cr.translate(width / 2, height / 2);
cr.scale(this._scale, this._scale);
if (this._leftHanded)
cr.rotate(Math.PI);
- cr.translate(-dimensions.width/2, -dimensions.height/2);
+ cr.translate(-dimensions.width / 2, -dimensions.height / 2);
this._handle.render_cairo(cr);
cr.restore();
cr.$dispose();
var PadOsd = class {
constructor(padDevice, settings, imagePath, editionMode, monitorIndex) {
this.padDevice = padDevice;
- this._groupPads = [ padDevice ];
+ this._groupPads = [padDevice];
this._settings = settings;
this._imagePath = imagePath;
this._editionMode = editionMode;
* have an active startup notification, we switch modes to display that.
*/
var AppMenuButton = GObject.registerClass({
- Signals: {'changed': {}},
+ Signals: { 'changed': {} },
}, class AppMenuButton extends PanelMenu.Button {
_init(panel) {
super._init(0.0, null, true);
});
var Button = GObject.registerClass({
- Signals: {'menu-set': {} },
+ Signals: { 'menu-set': {} },
}, class PanelMenuButton extends ButtonBox {
_init(menuAlignment, nameText, dontCreateMenu) {
super._init({ reactive: true,
cr.setLineWidth(thickness);
cr.moveTo(thickness / 2, h - thickness / 2);
- cr.lineTo(w/2, thickness);
+ cr.lineTo(w / 2, thickness);
cr.lineTo(w - thickness / 2, h - thickness / 2);
cr.stroke();
cr.$dispose();
delay: unitaryDelay * (N_ARROWS - (i + 1)),
time: ARROW_ANIMATION_TIME,
transition(t, b, c, d) {
- if (t < d/2)
- return TweenerEquations.easeOutQuad(t, 0, maxOpacity, d/2);
+ if (t < d / 2)
+ return TweenerEquations.easeOutQuad(t, 0, maxOpacity, d / 2);
else
- return TweenerEquations.easeInQuad(t - d/2, maxOpacity, -maxOpacity, d/2);
+ return TweenerEquations.easeInQuad(t - d / 2, maxOpacity, -maxOpacity, d / 2);
}
});
}
Gio.DBus.session.own_name('org.gnome.Shell.Screenshot', Gio.BusNameOwnerFlags.REPLACE, null, null);
}
- _createScreenshot(invocation, needsDisk=true) {
+ _createScreenshot(invocation, needsDisk = true) {
let lockedDown = false;
if (needsDisk)
lockedDown = this._lockdownSettings.get_boolean('disable-save-to-disk');
"Invalid params");
return;
}
- let flashspot = new Flashspot({ x : x, y : y, width: width, height: height});
+ let flashspot = new Flashspot({ x: x, y: y, width: width, height: height });
flashspot.fire();
invocation.return_value(null);
}
constructor(app) {
this._app = app;
- let layout = new St.BoxLayout({ vertical: false});
+ let layout = new St.BoxLayout({ vertical: false });
this.actor = new St.Button({ style_class: 'mount-dialog-app-list-item',
can_focus: true,
this._defaultButtons = [{ label: _("Cancel"),
action: this._onCancelButton.bind(this),
- key: Clutter.Escape
+ key: Clutter.Escape
},
{ label: _("Unlock"),
action: this._onUnlockButton.bind(this),
this._usesKeyfilesButtons = [{ label: _("Cancel"),
action: this._onCancelButton.bind(this),
- key: Clutter.Escape
+ key: Clutter.Escape
},
{ /* Translators: %s is the Disks application */
label: _("Open %s").format(disksApp.get_name()),
this._content = new Dialog.MessageDialogContent({ icon });
this.contentLayout.add(this._content, { x_fill: true, y_fill: false });
- let scrollView = new St.ScrollView({ style_class: 'mount-dialog-app-list'});
+ let scrollView = new St.ScrollView({ style_class: 'mount-dialog-app-list' });
scrollView.set_policy(St.PolicyType.NEVER,
St.PolicyType.AUTOMATIC);
this.contentLayout.add(scrollView,
if (enabled) {
interfaceSettings.set_string(KEY_GTK_THEME, HIGH_CONTRAST_THEME);
interfaceSettings.set_string(KEY_ICON_THEME, HIGH_CONTRAST_THEME);
- } else if(!hasHC) {
+ } else if (!hasHC) {
interfaceSettings.set_string(KEY_GTK_THEME, gtkTheme);
interfaceSettings.set_string(KEY_ICON_THEME, iconTheme);
} else {
_getNDevices() {
let adapter = this._getDefaultAdapter();
if (!adapter)
- return [ this._hadSetupDevices ? 1 : -1, -1 ];
+ return [this._hadSetupDevices ? 1 : -1, -1];
let nConnectedDevices = 0;
let nDevices = 0;
global.settings.set_boolean(HAD_BLUETOOTH_DEVICES_SETUP, this._hadSetupDevices);
}
- return [ nDevices, nConnectedDevices];
+ return [nDevices, nConnectedDevices];
}
_sync() {
- let [ nDevices, nConnectedDevices ] = this._getNDevices();
+ let [nDevices, nConnectedDevices] = this._getNDevices();
let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
this.menu.setSensitive(sensitive);
if (infosList.length == 0) {
let type = INPUT_SOURCE_TYPE_XKB;
let id = KeyboardManager.DEFAULT_LAYOUT;
- let [ , displayName, shortName] = this._xkbInfo.get_layout_info(id);
+ let [, displayName, shortName] = this._xkbInfo.get_layout_info(id);
infosList.push({ type: type, id: id, displayName: displayName, shortName: shortName });
}
if (!this._device)
return '';
- switch(this._device.state) {
+ switch (this._device.state) {
case NM.DeviceState.DISCONNECTED:
/* Translators: %s is a network identifier */
return _("%s Off").format(this._getDescription());
this._activeApChangedId = device.connect('notify::active-access-point', this._activeApChanged.bind(this));
// accessPointAdded will also create dialog items
- let accessPoints = device.get_access_points() || [ ];
+ let accessPoints = device.get_access_points() || [];
accessPoints.forEach(ap => {
this._accessPointAdded(this._device, ap);
});
network = { ssid: accessPoint.get_ssid(),
mode: accessPoint.mode,
security: this._getApSecurityType(accessPoint),
- connections: [ ],
+ connections: [],
item: null,
- accessPoints: [ accessPoint ]
+ accessPoints: [accessPoint]
};
network.ssidText = ssidToLabel(network.ssid);
this._checkConnections(network, accessPoint);
if (this._activeConnection == null)
return null;
- switch(this._activeConnection.vpn_state) {
+ switch (this._activeConnection.vpn_state) {
case NM.VpnConnectionState.DISCONNECTED:
case NM.VpnConnectionState.ACTIVATED:
return null;
}
_getSummaryIcon() {
- switch(this._category) {
+ switch (this._category) {
case NMConnectionCategory.WIRED:
return 'network-wired-symbolic';
case NMConnectionCategory.WIRELESS:
}
_getSummaryLabel(nDevices) {
- switch(this._category) {
+ switch (this._category) {
case NMConnectionCategory.WIRED:
return ngettext("%s Wired Connection",
"%s Wired Connections",
_clientGot(obj, result) {
this._client = NM.Client.new_finish(result);
- this._activeConnections = [ ];
- this._connections = [ ];
- this._connectivityQueue = [ ];
+ this._activeConnections = [];
+ this._connections = [];
+ this._connectivityQueue = [];
this._mainConnection = null;
this._mainConnectionIconChangedId = 0;
}
_readDevices() {
- let devices = this._client.get_devices() || [ ];
+ let devices = this._client.get_devices() || [];
for (let i = 0; i < devices.length; ++i) {
try {
this._deviceAdded(this._client, devices[i], true);
var SwitchMonitorPopup = GObject.registerClass(
class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
_init() {
- let items = [{ icon: 'view-mirror-symbolic',
+ let items = [{ icon: 'view-mirror-symbolic',
/* Translators: this is for display mirroring i.e. cloning.
* Try to keep it under around 15 characters.
*/
label: _('Mirror') },
- { icon: 'video-joined-displays-symbolic',
+ { icon: 'video-joined-displays-symbolic',
/* Translators: this is for the desktop spanning displays.
* Try to keep it under around 15 characters.
*/
label: _('Join Displays') },
- { icon: 'video-single-display-symbolic',
+ { icon: 'video-single-display-symbolic',
/* Translators: this is for using only an external display.
* Try to keep it under around 15 characters.
*/
label: _('External Only') },
- { icon: 'computer-symbolic',
+ { icon: 'computer-symbolic',
/* Translators: this is for using only the laptop display.
* Try to keep it under around 15 characters.
*/
// set the timeline to loop. Doing this means we have to track
// time ourselves, since clutter timeline's time will cycle
// instead of strictly increase.
- this._timeline = new Clutter.Timeline({ duration: 1000*1000 });
+ this._timeline = new Clutter.Timeline({ duration: 1000 * 1000 });
this._timeline.set_loop(true);
this._startTime = -1;
this._currentTime = -1;
_createPolicy() {
if (this._app && this._app.get_app_info()) {
- let id = this._app.get_id().replace(/\.desktop$/,'');
+ let id = this._app.get_id().replace(/\.desktop$/, '');
return new MessageTray.NotificationApplicationPolicy(id);
} else {
return new MessageTray.NotificationGenericPolicy();
this._cancelButton = this.addButton({ label: _("Revert Settings"),
action: this._onFailure.bind(this),
key: Clutter.Escape });
- this._okButton = this.addButton({ label: _("Keep Changes"),
+ this._okButton = this.addButton({ label: _("Keep Changes"),
action: this._onSuccess.bind(this),
default: true });
}
// If we don't have an empty workspace at the end, add one
- if (!emptyWorkspaces[emptyWorkspaces.length -1]) {
+ if (!emptyWorkspaces[emptyWorkspaces.length - 1]) {
workspaceManager.append_new_workspace(false, global.get_current_time());
emptyWorkspaces.push(true);
}
this._dy = 0;
this._enabled = true;
actor.connect('captured-event', this._handleEvent.bind(this));
- this._touchpadSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.peripherals.touchpad'});
+ this._touchpadSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.peripherals.touchpad' });
}
get enabled() {
// Scale deltas up a bit to make it feel snappier
this._dx += dx * 2;
- if(!(this._touchpadSettings.get_boolean('natural-scroll')))
+ if (!(this._touchpadSettings.get_boolean('natural-scroll')))
this._dy -= dy * 2;
else
this._dy += dy * 2;
var WorkspaceSwitchAction = GObject.registerClass({
Signals: { 'activated': { param_types: [Meta.MotionDirection.$gtype] },
'motion': { param_types: [GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
- 'cancel': { param_types: [] }},
+ 'cancel': { param_types: [] } },
}, class WorkspaceSwitchAction extends Clutter.SwipeAction {
_init(allowedModes) {
super._init();
//FIXME: Fix num buttons
for (let i = 0; i < 50; i++) {
let str = display.get_pad_action_label(pad, Meta.PadActionType.BUTTON, i);
- labels.push(str ? str: '');
+ labels.push(str ? str : '');
}
if (this._gsdWacomProxy) {
if (!this._allowFavoriteShortcuts())
return;
- let [,,,target] = binding.get_name().split('-');
+ let [, , , target] = binding.get_name().split('-');
let apps = AppFavorites.getAppFavorites().getFavorites();
let app = apps[target - 1];
if (app)
if (workspaceManager.n_workspaces == 1)
return;
- let [action,,,target] = binding.get_name().split('-');
+ let [action,,, target] = binding.get_name().split('-');
let newWs;
let direction;
const WorkspaceActor = GObject.registerClass(
class WorkspaceActor extends St.Widget {
vfunc_get_focus_chain() {
- return this.get_children().filter(c => c.visible).sort((a,b) => {
- let cloneA = (a._delegate && a._delegate instanceof WindowClone) ? a._delegate: null;
- let cloneB = (b._delegate && b._delegate instanceof WindowClone) ? b._delegate: null;
+ return this.get_children().filter(c => c.visible).sort((a, b) => {
+ let cloneA = (a._delegate && a._delegate instanceof WindowClone) ? a._delegate : null;
+ let cloneB = (b._delegate && b._delegate instanceof WindowClone) ? b._delegate : null;
if (cloneA && cloneB)
return cloneA.slotId - cloneB.slotId;
if (i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.UP)
indicator = new St.Bin({ style_class: 'ws-switcher-active-up' });
- else if(i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.DOWN)
+ else if (i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.DOWN)
indicator = new St.Bin({ style_class: 'ws-switcher-active-down' });
else
indicator = new St.Bin({ style_class: 'ws-switcher-box' });
const WorkspacesView = imports.ui.workspacesView;
// The maximum size of a thumbnail is 1/10 the width and height of the screen
-let MAX_THUMBNAIL_SCALE = 1/10.;
+let MAX_THUMBNAIL_SCALE = 1 / 10.;
var RESCALE_ANIMATION_TIME = 0.2;
var SLIDE_ANIMATION_TIME = 0.2;
var ThumbnailState = {
- NEW : 0,
- ANIMATING_IN : 1,
+ NEW: 0,
+ ANIMATING_IN: 1,
NORMAL: 2,
- REMOVING : 3,
- ANIMATING_OUT : 4,
- ANIMATED_OUT : 5,
- COLLAPSING : 6,
- DESTROYED : 7
+ REMOVING: 3,
+ ANIMATING_OUT: 4,
+ ANIMATED_OUT: 5,
+ COLLAPSING: 6,
+ DESTROYED: 7
};
/**
let [w, h] = this._thumbnails[i].actor.get_transformed_size();
let targetBottom = targetBase + WORKSPACE_CUT_SIZE;
let nextTargetBase = targetBase + h + spacing;
- let nextTargetTop = nextTargetBase - spacing - ((i == length - 1) ? 0: WORKSPACE_CUT_SIZE);
+ let nextTargetTop = nextTargetBase - spacing - ((i == length - 1) ? 0 : WORKSPACE_CUT_SIZE);
// Expand the target to include the placeholder, if it exists.
if (i == this._dropPlaceholderPos)
}
hide() {
- if (this._restackedNotifyId > 0){
+ if (this._restackedNotifyId > 0) {
Main.overview.disconnect(this._restackedNotifyId);
this._restackedNotifyId = 0;
}
}
_onEnter() {
- this._windowGroupVisibilityHandlerId =
+ this._windowGroupVisibilityHandlerId =
global.window_group.connect('notify::visible',
this._onWindowGroupVisibilityChanged.bind(this));
if (!cursorWindow.get_meta_window().is_override_redirect())
return;
- let constraint_position = new Clutter.BindConstraint({ coordinate : Clutter.BindCoordinate.POSITION,
- source: cursorWindow});
+ let constraint_position = new Clutter.BindConstraint({ coordinate: Clutter.BindCoordinate.POSITION,
+ source: cursorWindow });
this._cursorWindowClone = new Clutter.Clone({ source: cursorWindow });
Main.uiGroup.add_actor(this._cursorWindowClone);